import axios from "axios"
function uploadFile(path,userForm) {
    //转成编码格式
    const params = new FormData()
    for (let i in userForm) {
        //i如果是二进制的信息就不用传给后端
        // console.log(userForm[i]);
        if (i !== 'avatar') {
            params.append(i, userForm[i])
        }
    }
    return axios.post(path, params, {
        headers: {
            //标明传递给后端的数据格式
            "Content-Type": "multipart/form-data"
        }
    })
}
export default uploadFile